<script type="text/javascript">
  function smallsize(){
    document.getElementById('question_area').style.fontSize = "16px";
  }
  function mediumsize(){
    document.getElementById('question_area').style.fontSize = "20px";
  }
  function largesize(){
    document.getElementById('question_area').style.fontSize = "26px";
  }

  function check_answer(){
    var count = 0;
    var problem_no = '';
    <%@exam_questions.each do |q|%>
      boxes=document.getElementsByName("answer_<%=q.id%>");
      var checked = 0;
      for(var i=0;i<boxes.length;i++){
        if(boxes[i].checked){
         checked = checked + 1;
         break; // No need to check the rest since only one can be checked.
        }
      }
      if(checked==0){
        count = count + 1;
        if(problem_no==''){
          problem_no = "q_<%=q.id%>";
        }
      }
    <%end%>
    if(count>0){
      alert("ท่านยังไม่ได้ตอบคำถามจำนวน "+count+" ข้อ");
      window.location.hash = problem_no;
    }else{
      document.getElementById("exam").submit();
    }
  }
</script>
<table width="100%">
  <tr>
    <td align="right"><font color="red">เลือกขนาดตัวอักษร : </font></td>
    <td width="10px"><a href="#" style="font-size: 16px;" onclick="smallsize();">ก</a></td>
    <td width="10px"><a href="#" style="font-size: 20px;" onclick="mediumsize();">ก</a></td>
    <td width="10px"><a href="#" style="font-size: 26px;" onclick="largesize();">ก</a></td>
  </tr>
</table>